><

Basic style sheet syntax



Regardless of the way cascading style sheets are incorporated in your documents, the basic syntax is always the same. Style sheet specifications--commonly referred to as rules--consist of a single line of text with the following basic notation:

selector { property: value }

The selector element is an HTML tag or another item that the CSS syntax can address. The property element defines a style feature that the content will have when rendered by the browser. The value specifies how this feature is rendered.

The following is an example of a basic style sheet rule:

H1 {font-weight: bold; font-size: 24pt}

This rule instructs the browser to display the first-level header in 24 point size and bold typeface, overriding the browser's HTML preferences.


Using Cascading Style Sheets > About cascading style sheets > Basic style sheet syntax